#include <iostream>
#include<sys/time.h>
#include<unistd.h>
using namespace std;
const int n = 1200;
int main()
{

    cout << "Normal" << endl;
    //原始矩阵
    int** matrix = new int* [n];
    int m = 0;
    for (int i = 0; i < n; i++)
        matrix[i] = new int[n];
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            matrix[i][j] = m++;

    //初始化记录和的数组
    int* sum = new int[n];
    for (int j = 0; j < n; j++)
        sum[j] = 0;

    //平凡算法求和计时
    struct timeval start;
    struct timeval end;
    gettimeofday(&start, NULL);
    for (int j = 0; j < n; j++)
        for (int i = 0; i < n; i++)
            sum[j] += matrix[i][j];
    gettimeofday(&end, NULL);
    cout << "平凡算法：" << end.tv_sec - start.tv_sec << "ms" << endl;
    return 0;
}
